<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .boc{
            width: 100px;
            height: 100px;
            background-color: red;
        }
    </style>
</head>
<body>
    <div id="id">
        <!-- v-show 原理切换css的display：none来控制显示隐藏
             v-if 原理是根据判断条件来控制元素的创建和删除 
        -->
        <div class="boc" v-show="flag">我是v-show</div>
        <div class="boc" v-if="flag">我是v-if</div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.16/dist/vue.js"></script>
    <script>
        const app = new Vue({
            el:'#id',
            data:{
                flag:false
            }
        })
    </script>
</body>
</html>